package com.sumapay.fsb.config;

import com.alibaba.fastjson.JSON;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class ErrorPage implements ErrorController {

    @RequestMapping("/error")
    public String err() {
        Map<String, Object> map = new HashMap<>();
        map.put("ACTION_RESULT", 1);
        map.put("RESP_CODE", "310000000");
        map.put("RESP_MSG", "系统错误请重试或联系客服");
        return JSON.toJSONString(map);
    }


    @Override
    public String getErrorPath() {
        return null;
    }
}
